<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateBrandsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('brands', function (Blueprint $table) {
	        $table->engine = 'InnoDB';
	        $table->increments('id')->comment('品牌id');
	        $table->string('title', 32)->comment('品牌名')->default('');
	        $table->string('logo', 255)->comment('品牌logo')->default('');
	        $table->string('site', 255)->comment('官网地址')->default('');
	        $table->integer('sort_number')->comment('排序号')->default(0)->unsigned();
	        $table->timestamps();
	        $table->unique('title');
	        $table->index('sort_number');
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('brands');
    }
}
